home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-04-03 | 1.4 KB | 72 lines | [TEXT/MPS ] |
- // CalcUtilities.h
- // Copyright © 1986-96 by Apple Computer, Inc. All rights reserved.
-
- /*
- This unit contains some utility routines for the Calc sample application.
- It demonstrates how to use a library unit in a MacApp™ application.
- */
-
- #ifndef __CALCUTILITIES__
- #define __CALCUTILITIES__
-
- /* • requirements for this unit's interface. */
-
- // MacApp
-
- #ifndef __MACAPPTYPES__
- #include "MacAppTypes.h"
- #endif
-
- #ifndef __UGEOMETRY__
- #include "UGeometry.h"
- #endif
-
- // Toolbox
-
- #ifndef __QUICKDRAW__
- #include <Quickdraw.h>
- #endif
-
-
-
- // Formatting and Drawing routines
-
- void FitString(CStr255& theString,
- short maxWidth);
-
- CRect GetRgnBounds(RgnHandle aRgn);
- // returns the enclosed CRect of the rgn's bbox (subtracts 1 from right and bottom)
-
- Boolean IsDigit(char Ch);
-
- void SetEditCommandName(CommandNumber theCommand,
- CommandNumber customCommand);
-
- void SetTheFont(short fontNumber,
- short fontSize,
- Style fontStyle);
-
- void SmartDrawString(CStr255& theString,
- CRect area,
- short justification);
-
- // Reading and Writing
-
- void ReadScrap(Handle theScrap,
- long& scrapOffset,
- unsigned char* theData,
- short dataLength);
-
- void WriteScrap(Handle theScrap,
- long& scrapOffset,
- unsigned char* theData,
- short dataLength);
-
- // Max & Min overloaded functions
- short Max(short a, short b);
-
- short Min(short a, short b);
-
-
- #endif
-